
import base64
 
 
def encode_base64(img_path):
    with open(img_path,'rb') as f:
        img_data = f.read()
        base64_data = base64.b64encode(img_data)
        base64_str = str(base64_data, 'utf-8')  
        with open(r"temp", "w", encoding="utf-8")as f:
            f.write(base64_str)
 

if __name__ == '__main__':
    img_path = r'APP\institution_logo.png'
    encode_base64(img_path)


